<?php
error_reporting(E_ALL);

require_once "includes/Constant.php";
require_once "includes/WebRequest.php";
require_once "includes/cryptography/RC4CryptHandler.php";

ob_start();
session_start();

$_SESSION['time'] = time();

if(isset($_GET[Constant::$URI_FIELD])){
	
	//http://www.sweeting.org/mark/blog/2005/06/17/using-pear-cache_lite
	
	$request = new WebRequest(RC4CryptHandler::decrypt($_GET[Constant::$URI_FIELD]));
	
	$request->transform();
	
	header("Content-type: ".$request->getResponse()->getHeader("content-type"));
	header("Content-length: ".strlen($request->getContent()));
	
	print $request->getContent();
}
ob_end_flush();
?>